package com.pipi.biyesheji.dao.manager;

import com.pipi.biyesheji.dao.support.PageResult;
import com.pipi.biyesheji.dao.model.ProductDO;
import com.pipi.biyesheji.dao.query.ProductQuery;
import com.pipi.biyesheji.pojo.ProductVO;

import java.util.List;


/**
 * Manager for Product.
 */
public interface ProductManager {
    /**
     * query count by query condition.
     */
    int countByQuery(ProductQuery query);

    /**
     * delete by query condition.
     */
    int deleteByQuery(ProductQuery query);

    /**
     * delete by primary key.
     */
    int deleteByPrimaryKey(Long id);

    /**
     * insert selective.
     */
    long insertSelective(ProductDO record);

    /**
     * select by query condition.
     */
    List<ProductDO> selectByQuery(ProductQuery query);


    /**
     * select by query condition with page.
     */
    PageResult<ProductDO> selectByQueryWithPage(ProductQuery query);

    /**
     * select by primary key.
     */
    ProductDO selectByPrimaryKey(Long id);

    /**
     * update by query condition selective.
     */
    int updateByQuerySelective( ProductDO record,  ProductQuery query);

    /**
     * update by query condition.
     */
    int updateByQuery(ProductDO record, ProductQuery query);

    /**
     * update by primary key selective.
     */
    int updateByPrimaryKeySelective(ProductDO record);

    /**
     * <p> 随机获取5条数据 </p>
     * @param
     * @return List<ProductDO>
     * @throws
     * @author 皮皮 (pipi@maihaoche.com)
     * @date 2019/4/18 12:56 AM
     */
    List<ProductDO> randFive();

    /**
     * <p> 设置图片url </p>
     * @param productVO
     * @return int
     * @throws
     * @author 皮皮 (pipi@maihaoche.com)
     * @date 2019/4/18 1:11 AM
     */
    int setImageUrl(ProductVO productVO);
}